package com.jt.flight.controller;

import com.jt.flight.domain.User;
import com.jt.flight.model.Response;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by he on 2015/10/31.
 */
@Controller
@RequestMapping("/user")
public class UserController extends BaseController {

    @RequestMapping("/")
    public String index() {
        return "user/list";
    }

    @RequestMapping("/add")
    @ResponseBody
    public Object add(User user) {
        dao.insert(user);
        return Response.success("", "");
    }
}
